
from .authMiddleware import AuthMiddleware
from fastapi import Request,FastAPI,status 
from starlette.middleware.cors import CORSMiddleware

# 注册中间件
def register_middleware(app: FastAPI):
    
    # cors解决跨域
    app.add_middleware(
        CORSMiddleware,
        allow_origins=["*"],
        allow_headers=["*"]
    )

    # 健全
    app.add_middleware(AuthMiddleware)